//
//  WebServiceHelper.h
//  iphone.mobileoa
//
//  Created by 李亚春 on 13-5-22.
//  Copyright (c) 2013年 Epoint. All rights reserved.
//

#import <Foundation/Foundation.h>

@class WebServiceHelper;
@protocol WebServiceDelegate <NSObject>
@optional
-(void)requestFinished:(WebServiceHelper*)helper;
-(void)requestFailed:(WebServiceHelper*)helper;
@end
@interface WebServiceHelper : NSObject<NSURLConnectionDelegate,NSURLConnectionDataDelegate>
{
    NSString *wsurl;
    NSString *wsnamespace;
    NSString *method;
}

@property(readonly) BOOL isRequesting;
@property(retain,nonatomic) NSString* funName;
@property(retain,nonatomic) NSMutableString* funpars;
@property(retain,nonatomic)id<WebServiceDelegate> delegate;
@property(retain,nonatomic)NSError* error;
@property(retain,nonatomic) NSMutableData* responseData;

-(NSString *)getWSDLURL;
-(NSString*)getUploadURL;
-(NSMutableURLRequest*) getRequest:(NSString*)funcationName  parameter:(NSString*) pars;

-(id)initWebServiceWithUrl:(NSString*)_wsurl wsNamespace:(NSString *)_namespace method:(NSString *)_method;

-(void)uploadWithPath:(NSString*)filepath;
-(void)uploadWithImage:(UIImage*)image;

-(void)addParameterForString:(NSString*) name value:(NSString*)value;
-(void)addParameterForInt:(NSString *)name value:(NSInteger)value;
-(void)addParameterForFloat:(NSString *)name value:(CGFloat)value;
-(void)addParameterForBool:(NSString *)name value:(BOOL)value;
-(NSString *)start;
-(void)startSynchronous;
-(void)startASynchronous;
-(NSString*)getSimpleResult;
-(NSString*)getArrayResult;
@end
@interface UploadNSRequest : NSObject

+(NSMutableURLRequest*)uploading:(UIImage*)image message:(NSString*)mes;

@end
